<?php
namespace Admin\Controller;
use Think\Controller;
class GroupController extends CommonController {
    public function index(){
        $this->display();
    }

    /**
     * undocumented function
     *
     * @return void
     * @author 
     **/
    function add()
    { 
    	if(IS_POST){
            $_POST['rules'] = implode(',',$_POST['rules']);//转字符串
            // print_r($_POST['rules']);die;
          
            $id = $this->Model->add(I('post.'));
            // echo $this->Model->getLastSql();die;
            if($id>0){
            $this->success('添加成功',U('Admin/group/lists',2));die;
         }else{
            $this->error('添加失败',U('',2));die;
         }
        

    		// print_r(I('post.'));die;
    	}
    	$rule = D('rule')->select();
        $this->assign('rule',$rule);
    	$this->display();
    }
}